<template>
	<!-- <view class="my-search-container" :style="{'background-color':bgColor}">
		<view class="my-search-box" @click="handlerEvent">
			<uni-icons type="search" size="30"></uni-icons>
			<text class="placeholder">搜索</text>
		</view> 
	</view> -->
	<view class="my-search-container" :style="{'background-color':bgColor}">
		<view class="my-search-box" @click="handlerEvent">
			<uni-icons type="search" size="30"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		props:{
			bgColor:{
				type:String,
				default:'#c00000'
			}
		},
		data() {
			return {
				//bgColor:'#DD524D;'
			};
		},
		methods:{
			handlerEvent(){ 
				console.log('在搜索框上绑定事件');
				uni.navigateTo({
					url:'/subpkg/search/search'
				});
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss">
.my-search-container{
	background-color: #4CD964;
	height: 100rpx;
	padding: 0 20rpx;
	display: flex;
	align-items: center;
	.my-search-box{
		height: 70rpx;
		background-color: #1890FF;
		width: 100%;
		border-radius: 30rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
}
</style>
